package com.frxuexi.sign

import com.frxuexi.base.http.ApiService
import com.frxuexi.base.mvi.BaseViewModel
import com.frxuexi.base.mvi.RequestType
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class SignViewModel @Inject constructor(val apiService: ApiService):BaseViewModel<SignIntent>(){
    override fun handleIntent(it: SignIntent) {
        when(it){
            is SignIntent.addSign->httpRequest(apiService.addSign(toBody(it.item)),RequestType.ADD)
            is SignIntent.getSigns->httpRequest(apiService.getSigns(it.uid))
        }
    }
}